import { NovelCrawler } from './crawler';
import { config } from './config';

async function main() {
    const crawler = new NovelCrawler();
    try {
        const webSite = "zongheng";
        const novelUrl = config.sites[webSite].getNovelUrl();
        if (!novelUrl) {
            console.error('未找到小说URL或网站名称');
            return;
        }
        await crawler.crawlNovel(novelUrl, webSite);
        console.log('爬取完成！');
    } catch (error) {
        console.error('爬取过程中发生错误:', error);
    }
}

main();